%!TEX program = xelatex
\documentclass[t,12pt,aspectratio=169]{beamer} % 16:9 宽屏比例，适合现代投影， t = top alignment（顶部对齐）
\usepackage{ctex} % 中文支持
\usepackage{amsmath, amsthm, amssymb, bm} % 数学公式与符号
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{booktabs} % 用于高质量表格
\usepackage{tikz} % 可选：用于绘图
\usetikzlibrary{shapes,arrows,graphs}
\usepackage{pythonhighlight}
\usepackage{color}
\usepackage{dsfont} % 数学符号加粗

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%使表格美观
\usepackage{array}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
%\newcolumntype{N}{@{}m{0pt}@{}}
\setlength\extrarowheight{3pt}
\renewcommand{\tablename}{表}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 插入代码相关宏包 使代码美观
\usepackage{listings}
\usepackage{xcolor}

% 设置代码样式
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}

\lstdefinestyle{mystyle}{
    backgroundcolor=\color{backcolour},     % 背景色
    commentstyle=\color{codegreen},         % 注释颜色
    keywordstyle=\color{blue},              % 关键字颜色
    numberstyle=\tiny\color{codegray},      % 行号颜色
    stringstyle=\color{codepurple},         % 字符串颜色
    basicstyle=\footnotesize\ttfamily,      % 基本字体
    breakatwhitespace=false,                % 自动断行
    xleftmargin=2em, % 控制代码块整体右移：值越大，右移越多
    breaklines=true,
    captionpos=b,                           % 标题位置
    keepspaces=true,                        % 保留空格
    numbers=left,                           % 显示行号
    numbersep=10pt,                         % 行号与代码间距
    showspaces=false,                       % 不显示空格标记
    showstringspaces=false,                 % 字符串空格标记
    showtabs=false,                         % 不显示 tab 标记
    tabsize=4,                              % tab 宽度
    literate={\ }{{\ }}1,                   % 保留空格（可选）
    literate={\#}{{\#}}1                    % 正确显示 #
}

\lstset{style=mystyle} % 应用样式

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 主题设置（推荐简洁风格）
\usetheme{Madrid}
\usecolortheme{default} % 可选：default, seahorse, beaver, dolphin 等

% 自定义定理样式
\setbeamertemplate{theorems}[numbered]
\newtheorem{mydefinition}{定义}
\newtheorem{mytheorem}{定理}
\newtheorem{mylemma}{引理}
\newtheorem{mycorollary}{推论}
\newtheorem{myexample}{例}

% 信息设置
\title[利率与债券]{《金融数学》第7章：利率与债券}
%\author{ZFW}
%\author[]{LQW}
%\institute[XX大学]{XX大学\quad 数学与统计学院\quad 数学与应用数学专业}
%\date{2025年6月}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

% 封面页
\begin{frame}
  \titlepage
\end{frame}

% 目录页
%\begin{frame}{目录}
%  \tableofcontents
%\end{frame}

%\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{目录}

\begin{enumerate}
\item[7.1.]  利率模型
\begin{enumerate}
\item[7.1.1.]  单因子均衡利率模型
\item[7.1.2.]  单因子无套利利率模型
\end{enumerate}
\item[7.2.]  债券价格模型
\begin{enumerate}
\item[7.2.1.]  零息票与远期利率
\item[7.2.2.]  债券价格的一般模型
\item[7.2.3.]  {Vasicek}模型下的零息票定价模型
\item[7.2.4.]  债券的动态价格模型
\item[7.2.5.]  {CIR}模型下的零息票定价模型
\item[7.2.6.]  {Heath-Jarrow-Morton}模型
\end{enumerate}
\end{enumerate}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.1. 利率模型 }

\begin{itemize}

\item  {\color{red}利率是单位货币在单位时间内的利息水平。}是一定时期内利息额同借贷资本总额之间的比例。

\item  {\color{red}利率模型，也称为利率期限结构，是债券与其对应的离到期日时间之间的数学关系。}
利率模型反映了时间因素变化对利率的影响，可用贴现函数、零息票债券收益率或瞬时远期利率等来表示。

\item  两种利率模型：
\begin{enumerate}
\item  均衡模型
\item  无套利模型
\end{enumerate}


\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.1.1.单因子均衡利率模型  }

\begin{itemize}

\item  {\color{red}均衡模型是假设居民根据效用最大化原则，分配自己在不同时期的消费，生产部门的产出水平满足一定的随机过程，从而推导出均衡状态下利率期限结构必须满足的随机过程。}

\begin{enumerate}
\item   {1970}年：{Merton}模型
\item   {1977}年：{Vasicek}模型
\item   {1985}年：{Cox-Ingersoll-Ross}模型
\end{enumerate}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.1.1.1. {Vasicek}模型 }

\begin{itemize}

\item  {\color{red} {Vasicek}模型：利率 $r(t)$ 服从随机微分方程}
\begin{eqnarray*}
 {\color{red} dr(t) = a(b-r(t))dt + \sigma dW(t), \,\,\, r(0)=r_0. }
\end{eqnarray*}

\item  定理7.1.1. {Vasicek}模型中的利率 $r(t)$ 的期望和方差分别为
\begin{eqnarray*}
\mathbb{E}[r(t)] &=& b+e^{-at}(r_0-b), \\
\text{Var}[r(t)] &=& \frac{\sigma^2}{2a}(1-e^{-2at}).
\end{eqnarray*}

\item  证明：该随机微分方程的解为 
\begin{eqnarray*}
r(t) = b + e^{-at}(r_0-b) + \sigma \int_0^t e^{a(s-t)}dW(t). 
\end{eqnarray*}

\item  注：这个模型也称为{\color{red}均值回复模型}。

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.1.1.1. 例子计算 }

\begin{itemize}

\item  例子7.0. 使用 {SHIBOR:2}周的历史数据，估计 {Vasicek} 模型的参数。

\item  解答：
\begin{enumerate}
\item  取离散的时间点，设 $\Delta t=1$. 得到离散化的{Vasicek}模型
\begin{eqnarray*}
r_{k+1} - r_k &=& a(b-r_k) + \sigma \varepsilon_k \\
&=& ab - ar_k + \sigma\varepsilon_k.
\end{eqnarray*}
其中 $r_k$ 是 $k$ 时刻的利率，$\varepsilon_k$ 标准正态分布的随机变量。

\item  拟合一个线性回归模型，其中自变量为 $r_k$, 因变量为 $r_{k+1}-r_k$, 
\begin{eqnarray*}
Y_k = ab - aX_k + \sigma\varepsilon_k.
\end{eqnarray*}

\end{enumerate}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile=singleslide]{7.1.1.1. 例子计算 }

\begin{itemize}

\item  数据：2011年1月 - 9月，SHIBOR-2周的数据

{\footnotesize 
\begin{lstlisting}[language=R]
mydata=read.csv('shibor.csv')
mydata=mydata[,c(-3,-4,-5,-6,-7)]
colnames(mydata)=c('date','rate')
x=mydata[1:186,2]
y=diff(x)
x=x[-186]
lm01=lm(y~x)
summary(lm01)
plot(1:185,x,'l')
\end{lstlisting}
}

\item  求得回归模型为 $\hat{y} = 0.4264 -0.09365 x$, $\hat{\sigma} = 0.651$. 

\item  求得{Vasicek} 模型的参数为 $\hat{a}=0.09365$, $\hat{b}=4.553$, $\hat{\sigma} = 0.651$.

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile=singleslide]{7.1.1.1. 例子计算  }

{\footnotesize \color{blue}  
%\begin{lstlisting}[language=R]
\begin{verbatim}
Call: lm(formula = y ~ x)
Residuals:
    Min      1Q  Median      3Q     Max 
-3.2929 -0.2735 -0.0924  0.2153  3.0660 
Coefficients:
            Estimate Std. Error t value Pr(>|t|)   
(Intercept)  0.42640    0.14910   2.860  0.00473 **
x           -0.09365    0.03129  -2.993  0.00315 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.651 on 183 degrees of freedom
Multiple R-squared:  0.04665,	Adjusted R-squared:  0.04144 
F-statistic: 8.955 on 1 and 183 DF,  p-value: 0.003148
\end{verbatim}
%\end{lstlisting}
}


\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.1.1.1. 例子计算  }

\begin{figure}
\centering
\includegraphics[height=0.7\textheight, width=0.9\textwidth]{fig-ex-7-0-shibor-2011.png}
% \caption{ }
\end{figure}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.1.1.2. {CIR}模型 }

\begin{itemize}

\item  {Vasicek}模型的缺点：波动率是常数，这导致利率可能取负值。

\item  {\color{red}{Cox-Ingersoll-Ross}在{1985}年提出如下模型：}
\begin{eqnarray*}
{\color{red} dr(t) = a(b-r(t))dt + \sigma \sqrt{r(t)}dW(t), \,\,\, r(0)=r_0. }
\end{eqnarray*}

\item  定理7.1.2. {CIR}模型中的利率 $r(t)$ 的均值和方差分别为
\begin{eqnarray*}
\mathbb{E}[r(t)] &=& r_0e^{-at} +b(1-e^{-at}), \\
\text{Var}[r(t)] &=& \frac{\sigma^2}{a}r_0 (e^{-at}-e^{-2at}) + \frac{b\sigma^2}{2a}r_0 (1-e^{-at})^2. 
\end{eqnarray*}

\item  证明：根据这个随机微分方程可以得到 
\begin{eqnarray*}
r(t) = r_0e^{-at} + b(1-e^{-at}) + \sigma e^{-at} \int_0^t \sqrt{r(s)}dW(s).
\end{eqnarray*}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.1.1.2.  }

\begin{itemize}

\item  定理7.1.3. {CIR}模型的参数 $(a,b,r)$ 的伪极大似然估计为
\begin{eqnarray*}
a^* &=& -\Delta t^{-1} \log(\hat{\beta}_1), \\ 
b^* &=& \hat{\beta}_2, \\
\sigma^{*2} &=& 2a^*\hat{\beta}_3(1-\hat{\beta}_1^2)^{-1}, 
\end{eqnarray*}
其中 $\hat{\beta}_1, \hat{\beta}_2, \hat{\beta}_3$ 由利率历史数据 $(r_0,r_1,\cdots,r_n)$ 给出，
\begin{eqnarray*}
\hat{\beta}_1 &=& \\
\hat{\beta}_2 &=& \\
\hat{\beta}_3 &=& 
\end{eqnarray*}

\item  证明见 {CIR 1985} 年的论文。


\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.1.2. 单因子无套利利率模型  }

\begin{itemize}

\item  {\color{red}无套利模型以实际观察到的利率期限结构为模型输入变量，假设市场上不存在套利机会，推导出不同到期期限的债券的市场价格，从而根据预期理论得到未来瞬间利率必须服从的随机过程。}

\begin{enumerate}
\item  {1986}年：{Ho-Lee}模型
\item  {1990}年：{Hull-White}模型
\item  {1992}年：{Heath-Jarrow-Morton}模型
\end{enumerate}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.1.2.1. {Ho-Lee} 模型 }

\begin{itemize}

\item  {\color{red}{1986}年，{Ho-Lee}提出，短期利率 $r(t)$ 服从随机微分方程
\begin{eqnarray*}
dr(t) = \theta(t)dt + \sigma dW(t), \,\,\, r(0)=r_0,  
\end{eqnarray*}
其中 $\theta(t)$ 是确定的函数。}


\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.1.2.1.  }

\begin{itemize}

\item  定理7.1.4. {Ho-Lee}模型的解为 
\begin{eqnarray*}
r(t) = r_0 + \int_0^t \theta(s)ds + \sigma W(t), 
\end{eqnarray*}
利率 $r(t)$ 的期望和方差分别为 
\begin{eqnarray*}
\mathbb{E}[r(t)] &=& r_0 + \int_0^t \theta(s)ds, \\
\text{Var}[r(t)] &=& \sigma^2 t.
\end{eqnarray*}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.1.2.2. {Hull-White} 模型  }

\begin{itemize}

\item  {\color{red} {1990}年，{Hull-White} 提出，利率服从随机微分方程
\begin{eqnarray*}
dr(t) = a(b(t)-r(t))dt + \sigma dW(t), \,\,\, r(0)=r_0,  
\end{eqnarray*}
其中 $b(t)$ 是确定的函数。}

\item  注：若 $b(t)$ 是常数，这就是 {Vasicek} 模型。

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.1.2.2.  }

\begin{itemize}

\item  定理7.1.5. {Hull-White}模型的解为 
\begin{eqnarray*}
r(t) = r_0e^{-at} + a\int_0^t b(s)e^{a(s-t)}ds + \sigma \int_0^t e^{a(s-t)}dW(s), 
\end{eqnarray*}
利率 $r(t)$ 的期望和方差分别为 
\begin{eqnarray*}
\mathbb{E}[r(t)] &=& r_0e^{-at} + a\int_0^t b(s)e^{a(s-t)}ds, \\
\text{Var}[r(t)] &=& \frac{\sigma^2}{2a} (1-e^{-2at}).
\end{eqnarray*}

\item  证明：考虑 $d(e^{at}r(t))$. 

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2. 债券价格模型 }

\begin{itemize}

\item  问：什么是债券？

\item  答：债券是一种金融契约，是政府、金融机构、工商企业等直接向社会借债筹措资金时，向投资者发行，同时承诺按一定利率支付利息，并按约定条件偿还本金的债权债务凭证。

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.1. 零息票、收益率 }

\begin{itemize}

\item  一般的债券是带有息票的，这时的定价模型比较复杂。

\item  {\color{red} 零息票是一张在当前时刻 $t$ 以一个固定价格 $P(t,T)$ 买入，而在到期日 $T$ 换取1元现金的债券。}

\item  {\color{red} 收益率 $R(t,T)$ 是指 $T$ 年到期的债券在 $t$ 时刻应支付的年利率，即在区间 $[t,T]$ 上的平均年利率。收益率也称为即期利率。}

\item  收益率 $R(t,T)$ 与债券价格 $P(t,T)$ 的关系为
\begin{eqnarray*}
P(t,T) &=& \exp\left[ -(T-t)R(t,T) \right], \\ 
R(t,T) &=& \frac{-\ln P(t,T)}{(T-t)}. 
\end{eqnarray*}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.1. 远期利率 }

\begin{itemize}

\item  {\color{red} 远期利率是指隐含在给定的即期利率，从未来的某一时点到另一时点的利率。根据收益率曲线可以计算远期利率。}

\item  {\color{red} 远期利率 {(forward rate)} 是当前时刻确定的将来某个时刻买卖双方都可以接受的利率。即期利率{(spot rate)} 是当前时刻的利率。}

\item  设 $f(0,t)$ 表示 $t$ 时刻的远期利率，$R(t)$ 表示 $t$ 时刻的即期利率，则有
\begin{eqnarray*}
\frac{1}{t} \int_0^t f(0,s)ds &=& R(t), \\ 
f(0,t) &=& R(t) + tR'(t). 
\end{eqnarray*}



\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.1. 从利率计算债券价格 }

\begin{itemize}

\item  设利率是一个关于时间的确定函数 $r(t)$, 则有常微分方程
\begin{eqnarray*}
%\left\{ \begin{array}{rcl}
\frac{dP(t,T)}{dt} = r(t)P(t,T),\,\, 0\le t\le T, \,\,\, P(T,T) = 1. 
%\end{array}\right.
\end{eqnarray*}

\item  这时可以求得债券价格
$$P(t,T) = \exp\left[ -\int_t^T r(s)ds \right]. $$

\item  在 $r(t)=r$ 是常数的时候，债券价格为 $$P(t,T) = \exp\left[ -r(T-t) \right], $$ 这通常称为贴现因子。

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.1. 从债券价格计算即期利率 }

\begin{itemize}

\item  设已知债券价格，则可得即期利率为
$$r(t) = \frac{-\partial \ln P(t,T)}{\partial t}$$

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.1. 从随机利率计算债券价格 }

\begin{itemize}

\item  设利率是一个关于时间的随机函数，则可以将债券价格写成
$$ P(t,T) = \mathbb{E} \left[ \exp \left( -\int_t^T r(s)ds \right) \vert r(t)=r_t \right]. $$

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.1. 远期利率与债券价格的相互计算 }

\begin{itemize}

\item  设 $f(t,s)$ 表示在 $t$ 时刻约定的在 $s$ 时刻的远期利率，则有
$$P(t,T) = \exp\left[ -\int_t^T f(t,s)ds \right].$$

\item  从债券价格得到远期利率为
$$f(t,T)=\frac{-\partial \ln P(t,T)}{\partial T}. $$


\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.2. 债券价格的一般模型  }

\begin{itemize}

\item  {\color{red}定理：设短期利率符合随机微分方程
\begin{eqnarray*}
dr(t) = \mu(r(t),t)dt + \sigma(r(t),t)dW(t), 
\end{eqnarray*}
则债券价格 $P(r(t),t;T)$ 满足定解问题
\begin{eqnarray*}
\frac{\partial P}{\partial t} + (\mu-\lambda\sigma)\frac{\partial P}{\partial r} + \frac{\sigma^2}{2}\frac{\partial^2 P}{\partial r^2} -rP =0, \,\,\,\,\, P(r(T),T;T)=1.
\end{eqnarray*}
}

\item  短期利率的几个模型：
\begin{enumerate}
\item   {Merton} 模型 $dr(t) = \mu dt + \sigma dW(t)$. 
\item  {Vasicek} 模型 $dr(t) = a(b-r(t))dt + \sigma dW(t)$. 
\item  {Cox-Ingersoll-Ross}模型 $dr(t) = a(b-r(t))dt + \sigma \sqrt{r(t)}dW(t)$. 

\end{enumerate}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.2. 证明 }

\begin{enumerate}

\item  将 $P(r(t),t;T)$ 展开，写成 $r$ 和 $t$ 的幂级数，由定理假设，可得
\begin{eqnarray*}
dP(r(t),t;T) &=& \left( \mu \frac{\partial P}{\partial r} + \frac{1}{2}\sigma^2\frac{\partial^2 P}{\partial r^2} +\frac{\partial P}{\partial t} \right)dt + \sigma \frac{\partial P}{\partial r} dW(t) \\ 
&=:& u(t,T)dt + v(t,T)dW(t). 
\end{eqnarray*}

\item  构造一个投资组合 $\Pi = P_1-\Delta P_2$, 其中 $P_1=P_1(t,T_1)$ 和 $P_2=P_2(t,T_2)$ 是两个具有不同到期日 $T_1$ 和 $T_2$ 的零息票。计算短时间内的变化， 
\begin{eqnarray*}
d\Pi=dP_1 - \Delta dP_2 = (u_1-\Delta u_2)dt + (v_1-\Delta v_2)dW(t). 
\end{eqnarray*}

\item  取 $\Delta =v_1/v_2$, 由无套利原理得 $d\Pi = (u_1-\Delta u_2)dt =r\Pi dt$. 由此得到 
\begin{eqnarray*}
\frac{u_1(t,T_1) - rP_1(t,T_1)}{v_1(t,T_1)} = \frac{u_2(t,T_2) - rP_2(t,T_2)}{v_2(t,T_2)}  
= \frac{u(t,T) - rP(t,T)}{v(t,T)}=: \lambda (r,t). 
\end{eqnarray*}


\end{enumerate}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.2.  }

\begin{itemize}

\item  例子7.1. {\color{red}设短期利率满足 {Merton} 模型
$$dr(t) = \mu dt + \sigma dW(t), $$}
其中 $\mu,\sigma$ 都是常数。设 $\lambda$ 也是常数，求解债券价格定解问题
\begin{eqnarray*}
\frac{\partial P}{\partial t} + (\mu-\lambda\sigma)\frac{\partial P}{\partial r} + \frac{\sigma^2}{2}\frac{\partial^2 P}{\partial r^2} -rP =0, \,\,\,\,\, P(T,T)=1.
\end{eqnarray*}

\item  解答为 $$P(t,T)=\exp\left[ -(T-t)r -\frac{a}{2}(T-t)^2 +\frac{\sigma^2}{6}(T-t)^3. \right]$$


\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.2. 证明 }

\begin{enumerate}

\item  短期利率 {Merton} 模型的解为 $r(t) = r_0 + \mu t+ \sigma W(t)$. 

\item  设原方程有形式解 $P(t,T) = \exp[ A(t,T)r(t) + B(t,T)]$. 

\item  代入所求解的偏微分方程，可得
\begin{eqnarray*}
A'(t,T) &=& 1, \\  
B'(t,T) &=& -aA(t,T)-\frac{1}{2}\sigma^2 A(t,T)^2. 
\end{eqnarray*}

\item  由边值条件 $A(T,T)=0$ 与 $B(T,T)=0$ 可得 
\begin{eqnarray*}
A(t,T) &=& t-T, \\  
B(t,T) &=& -\frac{a}{2}(T-t)^2 + \frac{\sigma^2}{6}(T-t)^3. 
\end{eqnarray*}

\end{enumerate}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.2. 收益率曲线 }

\begin{itemize}

\item  收益率（也称即期利率） $R(t,T)$ 与债券价格 $P(t,T)$ 的关系为
$$R(t,T) = \frac{-\ln P(t,T)}{(T-t)}. $$

\item  在上述债券价格模型下，收益率曲线为 $$R(0,T) = r_0 + \frac{a}{2}T - \frac{\sigma^2}{6}T^2. $$

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.2. 例子计算 }

\begin{itemize}

\item  例子7.2. 设某银行发行的债券期限分别为1年、2年、3年、5年、7年、10年和14年，设对应的收益率分别为 
3.51, 4.54, 5.21, 6.46, 7.26, 7.99 和 8.30. 求五年期零息票的当前价格。

\item  解答：
\begin{enumerate}
\item  使用最小二乘法估计收益率曲线的表达式。 
\begin{table}[ht]
\centering 
\begin{tabular}{|c|c|c|c|c|c|c|c|}\hline 
$T$ &1&2&3&5&7&10&14 \\ \hline 
$R(0,T)$ &3.51\%&4.54\%&5.21\%&6.46\%&7.26\%&7.99\%&8.30\% \\ \hline 
\end{tabular}
\end{table}

\item  二次函数回归模型为 $\hat{R}(0,T) = 0.028+0.0089T-0.00036T^2$. 

\item  根据债券价格 $P(t,T)$ 与收益率 $R(t,T)$ 的关系式，可得五年期零息票的当前价格为 
$P(0,5)=\exp\left[ -(5-0)\hat{R}(0,5) \right] = 0.7274. $

\end{enumerate}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile=singleslide]{7.2.2. 例子计算 }

{\footnotesize 
\begin{lstlisting}[language=R]
##例子7-2：收益率曲线拟合
myT=c(1,2,3,5,7,10,14)
myR=c(3.51, 4.54, 5.21, 6.46, 7.26, 7.99, 8.30)*0.01
mydata=data.frame(myT=myT,myR=myR)
lm01=lm(myR~myT+I(myT^2)) #多项式回归
summary(lm01)
pred.frame=data.frame(myT=seq(0,15,0.5))
pp=predict(lm01,newdata=pred.frame,interval='pred') #预测
plot(myT,myR,xlab='T',ylab='R(0,T)',xlim=c(0,15),
	ylim=range(pp))
matlines(pred.frame$myT,pp,lty=c(1,2,2),col='red')
P05=exp(-5*pp[which(pred.frame$myT==5),1]) #找T=5时的预测值
print(P05)
\end{lstlisting}
}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.2. 例子计算  }

\begin{figure}
\centering
\includegraphics[height=0.8\textheight, width=0.9\textwidth]{fig-ex-7-2.png}
% \caption{ }
\end{figure}

\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.3. {Vasicek}模型下的零息票定价公式 }

\begin{itemize}

\item  {\color{red}设短期利率 $r(t)$ 服从 {Vasicek} 模型，}设风险的市场价格 $\lambda(t,r)$ 是利率 $r$ 的线性函数，这时，债券价格的一般模型写成
\begin{eqnarray*}
\frac{\partial P}{\partial t} + a(b-r)\frac{\partial P}{\partial r} + \frac{\sigma^2}{2}\frac{\partial^2 P}{\partial r^2} -rP =0, \,\,\,\,\, P(T,T)=1.
\end{eqnarray*}


\item  定理7.2.1. 这时可以求得债券价格具有形式 $$P(t,T)=A(t,T)e^{-r(t)B(t,T)}. $$
其中 $A(t,T)$ 和 $B(t,T)$ 是与参数 $a,b,\sigma$ 有关的函数。

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.4. 债券的动态价格模型 }

\begin{itemize}

\item  定理7.2.2. {\color{red}设利率服从 {Vasicek} 模型，}则到期日为 $T$ 的零息票债券价格服从随机微分方程
\begin{eqnarray*}
dP(t,T) = r(t) P(t,T)dt - \sigma B(t,T)P(t,T)dW(t).
\end{eqnarray*}


\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.4.  }

\begin{itemize}

\item  例子7.3. {\color{red}设利率服从 {Vasicek} 模型，}求解零息票债券价格的表达式。


\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.5. {CIR}模型下的息票定价公式  }

\begin{itemize}

\item  {\color{red}设短期利率 $r(t)$ 服从 {CIR} 模型，}设风险的市场价格 $\lambda(t,r)=0$, 这时，债券价格的一般模型写成
\begin{eqnarray*}
\frac{\partial P}{\partial t} + a(b-r)\frac{\partial P}{\partial r} + \frac{\sigma^2}{2}\frac{\partial^2 P}{\partial r^2} -rP =0, \,\,\,\,\, P(T,T)=1.
\end{eqnarray*}

\item  定理7.2.3. 这时可以求得债券价格具有形式 $$P(t,T)=A(t,T)e^{-r(t)B(t,T)}. $$ 


\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.6. {Heath-Jarrow-Morton} 模型 }

\begin{itemize}

\item  {HJM}模型分析从观察到的收益率曲线开始。这时的收益率曲线可以是在 $t=0$ 时刻的零息票债券价格 $P(0,T)$, 或者瞬时远期利率 $f(0,T)$. 

\item  由无套利原理，所有标的资产的瞬时收益率都是无风险利率 $r(t)$, 这时零息票债券价格 $P(0,T)$ 的动态方程为
\begin{eqnarray*}
dP(t,T) = r(t) P(t,T)dt + \sigma (t,T)P(t,T)dW(t).
\end{eqnarray*}

\item  由此得到远期利率模型为
\begin{eqnarray*}
df(t,T) = \mu(t,T)dt + \eta (t,T)dW(t).
\end{eqnarray*}


\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7.2.6.  }

\begin{itemize}

\item  {HJW}之谜：在 {HJW} 远期利率模型中，零息票债券的波动率决定了远期利率的漂移率，
\begin{eqnarray*}
\mu(t,T) = \eta(t,T) \int_t^T \eta(t,s)ds.
\end{eqnarray*}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{习题7 }

\begin{itemize}

\item[7.1.]  设短期利率 $r(t)$ 满足 {Merton} 模型 $dr(t) =\mu dt + \sigma dW(t)$, 其中 $\mu,\sigma$ 都是常数，求 $r(t)$ 的期望与方差。

\item[7.4.]  设某债券模型采用 $\sigma(t,T)=T-t$ 决定债券波动率。使用 {Vasicek} 利率模型下的零息票债券定价公式证明
$$r(t) = -\frac{\partial \ln P}{\partial t}(0,t) +\frac{t^2}{2}B^2(0,t) -W(t). $$ 

\item[7.5.]  设随机利率服从 {Ho-Lee} 模型，求零息票债券定价公式。

\item[7.6.]  设随机利率服从 {Hull-White} 模型，求零息票债券定价公式。

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[allowframebreaks]{参考文献}

\begin{thebibliography}{99}

\bibitem{zfw} 张寄洲，傅毅，王杨，金融数学，科学出版社，{2015}年{4}月第{1}版。

\bibitem{vasicek} {O. Vasicek. An equilibrium characterization of the term structure [J]. Journal of Financial Economics, 1977, 5: 177-188. }

\bibitem{cir} {J. C. Cox, J. E. Jr. Ingersoll, S. A. Ross. A theory of term structure of interest rates [J]. Econometrica, 1985, 53: 385-407. }

\bibitem{ho-lee} {T. S. Y. Ho, S. B. Lee. Term structure movements and pricing interest rate contingent claims [J]. Journal of Finance. 1986, 41: 1011-1029. }

\bibitem{hw} {J. Hull, A. White. Pricing interest-rate-derivative securities [J]. Review of Financial Studies, 1990, 3: 573-592.} 

\bibitem{hjm} {D. Heath, R. Jarrow, A. Merton. Bond pricing and the term structure of interest rates: a new methodology for contingent claims valuation [J]. Econometrica, 1992, (60)1: 77-105. }

\end{thebibliography}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}

